<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;

AppAsset::register($this);
?>
<?php $this->beginBlock('myjs') ?>
        function logout() {
            var csrf=$("#csrf").val();
            $.ajax({
            type: "POST",
            url: "<?=Yii::getAlias('@web')?>/user/security/logout",
            dataType: "json",
            data:
            {
                csrfToken:csrf
            },
            success: function(data)
            {
            },
            error: function(jqXHR)
            {
            },
            });
        }
<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['myjs'], \yii\web\View::POS_END); ?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>

<body class="nav-md">
<?php $this->beginBody() ?>
<div class="container body">
    <div class="main_container">
        <div class="col-md-3 left_col">
            <div class="left_col scroll-view">
                <div class="navbar nav_title" style="border: 0;">
                    <a href="#" class="site_title"><i class="fa fa-paw"></i> <span>CAATAPP</span></a>
                    <input type="hidden" name="_csrf" id='csrf' value="<?= \Yii::$app->request->csrfToken ?>">
                </div>

                <div class="clearfix"></div>

                <!-- menu profile quick info -->
                <div class="profile clearfix">
                </div>
                <!-- /menu profile quick info -->

                <br />

                <!-- sidebar menu -->
                <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
                    <div class="menu_section">
                        <h3>预测及可视化系统</h3>
                        <ul class="nav side-menu">
                            <li><a><i class="fa fa-sitemap"></i>代理人排名<span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="<?=\Yii::getAlias('@web')?>/sort/position">总排名</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/sort/round">销售额排名</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/sort/cnt">销售量排名</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/sort/pin">入度排名</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/sort/pout">出度排名</a></li>
                                </ul>
                            </li>

                            <?php
                            if(\Yii::$app->authManager->checkAccess(Yii::$app->user->id, 'admin')):
                            ?>
                            <li><a><i class="fa fa-edit"></i>用户权限 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="<?=Yii::getAlias('@web')?>/user/admin/index">用户管理</a></li>
                                    <li><a href="<?=Yii::getAlias('@web')?>/rbac/role/index">角色权限</a></li>
                                </ul>
                            </li>
                            <?php
                            endif;
                            ?>
                            <li><a><i class="fa fa-table"></i> 航空公司及代理人<span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="<?=\Yii::getAlias('@web')?>/site/all">查看总表</a></li>
                                </ul>
                            </li>
                            <li><a><i class="fa fa-bar-chart-o"></i> 原始数据指标 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="<?=\Yii::getAlias('@web')?>/site/index">航空公司及代理人销售情况</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/site/detail">具体代理人销售情况</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/site/cookcount">销售量Top</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/site/cookround">销售额Top</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/site/in">入度</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/site/out">出度</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/site/pagerank">PageRank</a></li>
                                </ul>
                            </li>
                            <li><a><i class="fa fa-clone"></i>预测数据指标 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="<?=\Yii::getAlias('@web')?>/predict/index">航空公司及代理人销售情况</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/predict/detail">具体代理人销售情况</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/predict/cookcount">销售量Top</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/predict/cookround">销售额Top</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/predict/in">入度</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/predict/out">出度</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/predict/pagerank">PageRank</a></li>
                                </ul>
                            </li>
                            <li><a><i class="fa fa-desktop"></i>原始对比预测 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="<?=\Yii::getAlias('@web')?>/compare/adetailc">全市场销售量对比</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/compare/adetailm">全市场销售额对比</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/compare/detailc">代理人销售量对比</a></li>
                                    <li><a href="<?=\Yii::getAlias('@web')?>/compare/detailm">代理人销售额对比</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>


                </div>
                <!-- /sidebar menu -->

                <!-- /menu footer buttons -->
            
                <!-- /menu footer buttons -->
            </div>
        </div>

        <!-- top navigation -->
        <div class="top_nav">
            <div class="nav_menu">
                <nav>
                    <div class="nav toggle">
                        <a id="menu_toggle"><i class="fa fa-bars"></i></a>
                    </div>

                    <ul class="nav navbar-nav navbar-right">
                        <?php
                            if(Yii::$app->user->isGuest):
                        ?>
                                <li class="">
                                    <a href="<?=\Yii::getAlias('@web')?>/user/login">
                                        登录
                                    </a>
                                </li>
                        <?php
                            else:
                        ?>
                            <li class="">
                                <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                    <?=\Yii::$app->user->identity->username?>
                                    <span class=" fa fa-angle-down"></span>
                                </a>
                                <ul class="dropdown-menu dropdown-usermenu pull-right">
                                    <li><a href="<?=Yii::getAlias('@web')?>/user/settings/profile"> 简介</a></li>
                                    <li>
                                        <a href="<?=Yii::getAlias('@web')?>/user/settings/account">
                                            <span>帐户设置</span>
                                        </a>
                                    </li>
                                            <?php
                                                if(\Yii::$app->authManager->checkAccess(Yii::$app->user->id, 'admin')):
                                            ?>
                                                    <li><a href="<?=Yii::getAlias('@web')?>/user/admin/index"> 用户管理</a></li>
                                            <?php
                                                endif;
                                            ?>
                                    <li>
                                    <a href="javascript:void(0);" onclick="logout()"><i class="fa fa-sign-out pull-right"></i>
                                    登出
                                    </a>
                                    </li>
                                </ul>
                            </li>

                           <?php
                                endif;
                           ?>
                    </ul>
                </nav>
            </div>
        </div>
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main">
            <?= $content ?>
        </div>
        <!-- /page content -->

        <!-- footer content -->

        <!-- /footer content -->
    </div>
</div>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
